package com.vehicle.core.dto;

import java.io.Serializable;
import java.util.Date;

/**
 * @author shouhan
 * @version 1.0
 * @date 2018/12/28
 * @desc 全局参数返回值
 * @see
 * @since 1.0
 */
public class Result<T> implements Serializable {
    /**
     * 返回码
     */
    private Integer code;
    /**
     * 信息
     */
    private String message;
    /**
     * 业务数据
     */
    private T data;
    /**
     * 服务器时间
     */
//    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    private Date serverTime;
    /**
     * 堆栈信息, 开发阶段返回
     */
    private Object stack;

    public Result(Integer code, T data) {
        this.code = code;
        this.data = data;
    }

    public Result() {
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

    public Date getServerTime() {
        return serverTime;
    }

    public void setServerTime(Date serverTime) {
        this.serverTime = serverTime;
    }

    public Object getStack() {
        return stack;
    }

    public void setStack(Object stack) {
        this.stack = stack;
    }
}
